package com.hinnotek.amoeba.repo

import com.hinnotek.amoeba.api.ApiService
import com.hinnotek.amoeba.bean.old.*
import com.lee.common.base.BaseRepository
import com.lee.common.network.net.StateLiveData
import javax.inject.Inject

class ManageRepo @Inject constructor(private val service: ApiService): BaseRepository() {

    /**
     * app端获取合同列表分页接口
     */
    suspend fun getSysOrgAmibaList(stateLiveData: StateLiveData<MutableList<AmountAllocatedBean>>){
        executeResp({ service.getSysOrgAmibaList() }, stateLiveData)
    }

    suspend fun getAmibaCustomerDetail(orgId: Int, stateLiveData: StateLiveData<MutableList<StatisticalCustomerProjectBean>>) {
        executeResp({ service.getAmibaCustomerDetail(orgId) }, stateLiveData)
    }

    suspend fun getAmibaProjectDetail(orgId: Int, stateLiveData: StateLiveData<MutableList<StatisticalRDProjectBean>>) {
        executeResp({ service.getAmibaProjectDetail(orgId) }, stateLiveData)
    }

    suspend fun getSysOrgAmibaDetailList(stateLiveData: StateLiveData<MutableList<SysOrgAmibaDetailListBean>>) {
        executeResp({ service.getSysOrgAmibaDetailList() }, stateLiveData)

    }

    suspend fun getSysOrgDetailById(orgId: Int, stateLiveData: StateLiveData<SysOrgDetailByIdBean>) {
        executeResp({ service.getSysOrgDetailById(orgId) }, stateLiveData)
    }

    suspend fun getNewUpdateVersion(stateLiveData: StateLiveData<VersionBean>) {
        executeResp({ service.updateVersion() }, stateLiveData)
    }

}